package com.moody.service;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.moody.hibernate.domain.ClassifyRecord;
import com.moody.hibernate.domain.CollateralInfo;
import com.moody.hibernate.domain.CustDefaultEvent;
import com.moody.hibernate.domain.DebtCollateral;
import com.moody.hibernate.domain.DebtCollateralId;
import com.moody.hibernate.domain.DebtInfo;
import com.moody.hibernate.domain.GuaranteeInfo;
import com.moody.hibernate.domain.GuaranteeInfoId;
import com.moody.hibernate.domain.GuarantorInfo;

/*
 * Copyright © Moody analytics
 *
 * @Author: Yan Jian
 * @Time: 2011-10-17 下午08:32:43
 * @Modified by: 
 * @Description: 
 */
@Service
public interface ObligationService {

	List<CollateralInfo> findAllCollateralByInputID();

	void insertCollateral(CollateralInfo collateralInfo);

	CollateralInfo findCollateralById(String collateralId);

	void updateCollateral(CollateralInfo collateralInfo);

	void deleteCollateralById(String collateralId);

	List<DebtCollateral> findDebtCollateralByCollateralId(String collateralId);

	List<DebtInfo> findDebtByCustId(String debtCustId);

	void deleteDebtById(String debtNo);

	void insertDebt(DebtInfo debtInfo);

	List<ClassifyRecord> findAllClassifyRecordByAuthID(String classifyStatus,String userId,String orgId);

	DebtInfo findDebtInfoById(String debtNo);

	ClassifyRecord findClassifyRecordById(String serialNo);

	void updateClassifyRecord(ClassifyRecord cr);

	void updateDebtInfo(DebtInfo debt);

	List<CustDefaultEvent> findAllCustDefaultEventByAuthID(String status,String userId,String orgId);

	CustDefaultEvent findCustDefaultEventById(String serialNo);

	void updateCustDefaultEvent(CustDefaultEvent de);

	List<CustDefaultEvent> findAllCustDefaultEventByCustId(String custId);

	void insertCustDefaultEvent(CustDefaultEvent custDefaultEvent);

	void deleteCustDefaultEventById(String serialNo);

	void insertClassifyRecord(ClassifyRecord classifyRecord);

	List<ClassifyRecord> findClassifyRecordByDebtNo(String debtNo);

	List<DebtCollateral> findDebtCollateralByDebtNo(String debtNo);

	void insertDebtCollateral(DebtCollateral debtCollateral);

	DebtCollateral findDebtCollateralById(DebtCollateralId id);

	void deleteDebtCollateral(DebtCollateral debtCollateral);

	void updateDebtCollateral(DebtCollateral debtCollateral);

	List<GuaranteeInfo> findDebtGuarantorByDebtNo(String debtNo);

	GuaranteeInfo findDebtGuarantorById(GuaranteeInfoId id);

	void insertDebtGuarantee(GuaranteeInfo guaranteeInfo);

	void updateDebtGuaranteeInfo(GuaranteeInfo guaranteeInfo);

	void deleteDebtGuaranteeById(GuaranteeInfoId id);

	void deleteDebtGuarantee(GuaranteeInfo guaranteeInfo);
	
	public Double calDebtBalanceSumByCustId(String custId);

	void insertGuarantorInfo(GuarantorInfo guarantorInfo);

	List<GuarantorInfo> findAllGuarantor();

	GuarantorInfo findGuarantorById(String guarantorId);

	void updateGurantor(GuarantorInfo guarantorInfo);

	List<GuaranteeInfo> findGuaranteeByGuarantorId(String guarantorId);

	void deleteGuarantorById(String guarantorId);
	
	public boolean hasUsed(String debtNo);

	List<CollateralInfo> findCollateralByCondition(
			Map<String, String> condition, String userId, String orgId);

	List<GuarantorInfo> findGuarantorByCondition(Map<String, String> condition,
			String userId, String orgId);
	
}
